# -*-coding: utf-8 -*-
"""
    @Theme   : Suzy Questions and Answers
    @Time    : 2024/7/7 14:07
    @Author  : YamFish
    @Url     : https://www.zhihu.com/people/yamfish
"""
from flask import Flask

from qanda.views.auth import auth_bp
from qanda.views.qaa import qaa_bp
from qanda.commands import register_cmd
from qanda.models_business import db_utils


def make_app():
    app = Flask(__name__)
    app.config.from_pyfile('settings.py')
    app.jinja_env.trim_blocks = True
    app.jinja_env.lstrip_blocks = True

    db_utils.init(app)
    register_cmd(app)
    app.register_blueprint(auth_bp)
    app.register_blueprint(qaa_bp)

    return app

